package v1

import (
	"donkey-admin/internal/model/entity"
	"github.com/gogf/gf/v2/frame/g"
)

type ApiSyncToCacheReq struct {
	g.Meta `path:"/Apis.SyncToCache" tags:"Api" method:"get" summary:"从内存同步API接口到数据库"`
}

type ApiSyncToCacheRes struct {
}

type ApiGetAllReq struct {
	g.Meta   `path:"/Apis.Get" tags:"Api" method:"get" summary:"获取所有API接口"`
	PageSize int `json:"pageSize" v:"required|between:1,50#pageSize为必填参数|pageSize应大于等于1且小于等于50"`
	Page     int `json:"page" v:"required|min:0#page为必填参数|page应大于等于0"`
}

type ApiGetAllRes struct {
	PageSize int              `json:"pageSize"`
	Page     int              `json:"page"`
	Total    int              `json:"total"`
	Rows     []entity.SysApis `json:"rows"`
}

type ApiAddReq struct {
	g.Meta    `path:"/Apis.Add" tags:"Api" method:"post" summary:"新增API接口"`
	ApiPath   string `json:"apiPath" v:"required#API地址为必填参数"`  // API地址
	ApiMethod string `json:"apiMethod" v:"required#请求方式为必填参数"` // 请求方式
	ApiInfo   string `json:"apiInfo" v:"required#API信息为必填参数"`  // API信息
	ApiGroup  string `json:"apiGroup" v:"required#API分组为必填参数"` // API分组
}

type ApiAddRes struct {
}
